﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections;

/// <summary>
///opeartorman 的摘要说明
/// </summary>
public class opeartorman
{
    public opeartorman()
    {
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }
    /// <summary>
    /// 员工登录
    /// </summary>
    /// <param name="uname">用户名</param>
    /// <param name="password">密码</param>
    /// <returns>sqldataread对象</returns>
    public bool login(string uname, string password)
    {
        string login_staff = "select no,password from opeartorman where no='" + uname + "'  and password='" + password + "'";
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["medical"].ConnectionString);
        DataSet myds = new DataSet();
        con.Open();
        SqlDataAdapter SelectAdapter = new SqlDataAdapter();
        SelectAdapter.SelectCommand = new SqlCommand(login_staff, con);
        SelectAdapter.SelectCommand.ExecuteNonQuery();
        SelectAdapter.Fill(myds);
        con.Close();
        if (myds.Tables[0].Rows.Count>0)
        {
            return true;
        }
        else
            return false;
        
    }
    
}
